<template>
  <div>
    <el-descriptions class="margin-top " :contentStyle="CS" :label-style="LS" title="" :column="2" size="medium"
                     border>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-c-scale-to-original"></i>
          客户名称
        </template>
        {{ invoiceInfo.customerName }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-time"></i>
          税号
        </template>
        {{ invoiceInfo.taxNo }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-money"></i>
          开票金额
        </template>
        {{ invoiceInfo.amount }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-money"></i>
          核销金额
        </template>
        {{ invoiceInfo.pinMoney }}
      </el-descriptions-item>

      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-money"></i>
          剩余核销
        </template>
        {{ invoiceInfo.pinRemain }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-c-scale-to-original"></i>
          订单编号
        </template>
        {{ invoiceInfo.projectNo }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-bank-card"></i>
          开票明细
        </template>
        <file-upload-show :value="invoiceInfo.files"></file-upload-show>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-money"></i>
          开票时间
        </template>
        {{ parseTime(invoiceInfo.invoiceDate, '{y}-{m}-{d} {h}:{i}:{s}') }}
      </el-descriptions-item>

      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-bank-card"></i>
          发票文件
        </template>
        <file-upload-show :value="invoiceInfo.invoiceFile"></file-upload-show>
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import {deleteAction, getAction, getById} from '@/api/manage'
import FileUploadShow from "@/components/FileUpload/FileUploadShow.vue";

export default {
  name: "GoodsInvoiceDetailSection",
  components: {
    FileUploadShow
  },
  props: {
    invoiceId: {
      type: String,
      default: "",
    },
  },
  watch: {
    invoiceInfo: {
      handler(newVal, oldVal) {
        this.getInvoiceInfo();
      },
      immediate: true
    },
  },
  data() {
    return {
      invoiceInfo:{},
      // 查询参数
      CS: {
        'text-align': 'center',  //文本居中
        'min-width': '250px',   //最小宽度
        'word-break': 'break-all'  //过长时自动换行
      },
      LS: {
        'color': '#000',
        'text-align': 'center',
        'font-weight': '600',
        'height': '40px',
        'min-width': '110px',
        'word-break': 'keep-all'
      },
      url: {
        getById: '/goodsInvoice/goodsInvoice/',
      },
    };
  },
  created() {
  },
  destroyed() {
  },
  methods: {
    /** 修改按钮操作 */
    getInvoiceInfo() {
      let that = this;
      getById(that.url.getById, this.invoiceId).then(response => {
        that.invoiceInfo = response.data;
      });
    },
  }


};
</script>
